#!/bin/csh -f

if( ! $?TESTsander ) set TESTsander = "../../../../exe/pbsa"

if( ! $?DO_PARALLEL ) then
        setenv DO_PARALLEL " "
else
    echo "This test not set up for parallel"
    echo " cannot run in parallel with pbsa"
    exit 0
endif

set output = mdout.dadt.min

cat > min.in <<EOF
 test of pbsa
 &cntrl
   ntx=1, imin=1,
   igb=10, inp=0
 /
 &pb
   npbverb=0, istrng=0, epsout=80.0, epsin=1.0, space=0.5,
   accept=1e-9, sprob=0.6, radiopt=0, fillratio=2, bcopt=6,
   dbfopt=1, cutnb=12, npopt=0, smoothopt=1, frcopt=2, 
   nfocus=1, cutsa=11, cutres=15,
   offx=.23417615283669545579, offy=.10868404187139500106, offz=.09561449018829920346,
 /
EOF

touch dummy
$DO_PARALLEL $TESTsander -O -i min.in -o $output < dummy || goto error

   echo "checking dadt force"
   if ( ! -f force.dat || ! -f force.save ) then
      echo "FAILED: file not exist"
      exit(1)
   endif
   if ( `diff force.dat force.save | cat | wc -c` != 0 ) then
      echo "FAILED: dadt force"
      exit(0)
   else
      echo "PASSED" 
   endif 
   rm *.dat

#../../../dacdif $output.save $output
/bin/rm -f min.in restrt mdinfo dummy $output
exit(0)

error:
echo "  ${0}:  Program error"
exit(1)
